package org.example.campus_sys_backend.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.campus_sys_backend.model.TeacherInfo;

@Mapper
public interface TeacherInfoMapper {
    @Insert("insert into teacher (id, teacher_name, subject, profession, school, introduce, user_id) " +
            "values (#{id}, #{teacherName}, #{subject}, #{profession}, #{school}, #{introduce}, #{userId})")
    Integer insertTecaher(TeacherInfo teacherInfo);
    @Select("select id, teacher_name, subject, profession, school, introduce, user_id from teacher " +
            "where id = #{id}")
    TeacherInfo queryTeacherById(Integer id);
    @Select("select * from teacher where teacher_name = #{teacherName}")
    TeacherInfo queryTeacherByName(String teacherName);

}
